import request from '@/utils/request'

// 集团起诉案件审批 VO
export interface LawsuitApprovalVO {
  id: number // 主键编号
  processInstanceId:string
  caseNumber: string // 案件编号
  involvedEntity: string // 涉案单位
  submitter: string // 资料提交人
  submitterPhone: string // 联系电话
  caseReason: string // 案由
  amountInvolved: number // 涉案标的
  defendant: string // 被起诉人
  defendantPhone: string // 被起诉人联系电话
  submissionDate: string|number // 提交时间
  numberOfCopies: number // 提交份数
  briefCaseDetails: string // 简要案情
  prosecutionReason: string // 起诉理由
  prosecutionObjective: string // 起诉目的
  legalDeptHeadOpinion: string // 法务部负责人审批意见
  legalDeptHeadSignature: string // 法务部负责人签字
  legalDeptHeadSignTime: Date // 法务部负责人签字时间
  divisionLeaderOpinion: string // 分管领导审批意见
  divisionLeaderSignature: string // 分管领导签字
  divisionLeaderSignTime: Date // 分管领导签字时间
  generalManagerOpinion: string // 总经理审批意见
  generalManagerSignature: string // 总经理签字
  generalManagerSignTime: Date // 总经理签字时间
  chairmanOpinion: string // 董事长审批意见
  chairmanSignature: string // 董事长签字
  chairmanSignTime: Date // 董事长签字时间
  remark: string // 备注
  status:number,
  startUserSelectAssignees:any
  isApproved:any
   [key: string]: any
}

// 集团起诉案件审批 API
export const LawsuitApprovalApi = {
  // 查询集团起诉案件审批分页
  getLawsuitApprovalPage: async (params: any) => {
    return await request.get({ url: `/bpm/lawsuit-approval/page`, params })
  },

  // 查询集团起诉案件审批详情
  getLawsuitApproval: async (id: number) => {
    return await request.get({ url: `/bpm/lawsuit-approval/get?id=` + id })
  },

  // 新增集团起诉案件审批
  createLawsuitApproval: async (data: LawsuitApprovalVO) => {
    return await request.post({ url: `/bpm/lawsuit-approval/create`, data })
  },

  // 修改集团起诉案件审批
  updateLawsuitApproval: async (data: LawsuitApprovalVO) => {
    return await request.put({ url: `/bpm/lawsuit-approval/update`, data })
  },

  // 删除集团起诉案件审批
  deleteLawsuitApproval: async (id: number) => {
    return await request.delete({ url: `/bpm/lawsuit-approval/delete?id=` + id })
  },

  // 导出集团起诉案件审批 Excel
  exportLawsuitApproval: async (params:any) => {
    return await request.download({ url: `/bpm/lawsuit-approval/export-excel`, params })
  },
}
